
setwd()



### read in data

lr <- read.csv("Kaj_SRRS_LR18.csv")
sr <- read.csv("Kaj_SRRS_SR1819.csv")

head(lr)
head(sr)



### total vegetation cover - long rains 2018 base model

a1 <- aov(lr$tvc_outcome ~ lr$tvc_baseline + lr$treatment)
anova(lm(a1))
summary(lm(a1))
coefficients(a1)



### total vegetation cover - short rains 2018-2019 base model

a2 <- aov(sr$tvc_outcome ~ sr$tvc_baseline + sr$treatment)
anova(lm(a2))
summary(lm(a2))
coefficients(a2)



### total vegetation cover - long rains 2018 additional models

a1b <- aov(lr$tvc_outcome ~ lr$tvc_baseline + lr$treatment + lr$saltysoil)
anova(lm(a1b))
summary(lm(a1b))

a1c <- aov(lr$tvc_outcome ~ lr$tvc_baseline + lr$treatment + lr$rockysoil)
anova(lm(a1c))
summary(lm(a1c))

a1d <- aov(lr$tvc_outcome ~ lr$tvc_baseline + lr$treatment + lr$flooding)
anova(lm(a1d))
summary(lm(a1d))

a1e <- aov(lr$tvc_outcome ~ lr$tvc_baseline + lr$treatment + lr$gpo_tlud)
anova(lm(a1e))
summary(lm(a1e))

a1f <- aov(lr$tvc_outcome ~ lr$tvc_baseline + lr$treatment + lr$dist2town_km)
anova(lm(a1f))
summary(lm(a1f))



### total vegetation cover - short rains 2018-2019 additional models

a2b <- aov(sr$tvc_outcome ~ sr$tvc_baseline + sr$treatment + sr$saltysoil)
anova(lm(a2b))
summary(lm(a2b))

a2c <- aov(sr$tvc_outcome ~ sr$tvc_baseline + sr$treatment + sr$rockysoil)
anova(lm(a2c))
summary(lm(a2c))

a2d <- aov(sr$tvc_outcome ~ sr$tvc_baseline + sr$treatment + sr$flooding)
anova(lm(a2d))
summary(lm(a2d))

a2e <- aov(sr$tvc_outcome ~ sr$tvc_baseline + sr$treatment + sr$gpo_tlud)
anova(lm(a2e))
summary(lm(a2e))

a2f <- aov(sr$tvc_outcome ~ sr$tvc_baseline + sr$treatment + sr$dist2town_km)
anova(lm(a2f))
summary(lm(a2f))



### % 1 m canopy gaps - long rains 2018 model

a3 <- aov(lr$cgp_outcome ~ lr$cgp_baseline + lr$treatment)
anova(lm(a3))
summary(lm(a3))
coefficients(a3)



### % 1 m canopy gaps - short rains 2018-2019 model

a4 <- aov(sr$cgp_outcome ~ sr$cgp_baseline + sr$treatment)
anova(lm(a4))
summary(lm(a4))
coefficients(a4)











